﻿<div class="row">
    <div class="col-lg-21 col-sm-12 col-xs-12">
        <div class="widget flat radius-bordered">
            <div class="widget-header bg-themeprimary">
                <span class="widget-caption">Payment</span>
            </div>
            <div class="widget-body">
                <div class="widget-main">
                    <!--Payment Info-->
                    <div ng-controller="PaymentController">

                        <form class="form-horizontal ng-pristine" role="form" ng-if="showFormPerfectmoneyInfo">
                            <div class="row">
                                <div class="col-lg-6 col-sm-6 col-xs-12 col-md-offset-3">
                                    <div class="form-title text-align-center">
                                        Perfectmoney Info
                                    </div>
                                    <div class="form-group">
                                        <label for="inputEmail3" class="col-sm-3 control-label no-padding-right">Payer</label>
                                        <div class="col-sm-8">
                                            <input class="form-control" ng-model="data.Payer_Account" disabled>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="" class="col-sm-3 col-md-offset-3">
                                            <button type="submit" class="btn btn-blue" ng-click="doBilling(data)">Payment</button>
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </form>

                        <form class="form-horizontal ng-pristine" role="form" ng-if="showFormBitcoin">
                            <div class="row">
                                <div class="col-lg-7 col-sm-7 col-xs-12 col-md-offset-3">  
                                    <div class="">
                                        <div class="form-title text-align-center">
                                            Bitcoin Info
                                        </div> 
                                        <div class="form-group">
                                            <label><strong>Step 1:</strong> How many money you wish to add fund?</label>
                                            <input class="form-control" ng-model="BitcoinAccount.Amount" placeholder="Amount" type="text" ng-change="doInput(BitcoinAccount)">
                                        </div>
                                        <div class="form-group" ng-if="!showQRCode">
                                            <p class="text-align-center"><i class="fa fa-5x fa-circle-o-notch fa-spin"></i></p>
                                        </div>
                                        <div class="form-group" ng-if="showQRCode">
                                            <label><strong>Step 2:</strong> <br />Send the Bitcoins to the QR code below</label>
                                            <div class="text-align-center">
                                                <qrcode size="220" data="bitcoin:{{BitcoinAccount.Address}}?amount={{BitcoinAccount.Amount}}"></qrcode>
                                                <p class="text-align-center">
                                                    <small>
                                                        {{BitcoinAccount.Address}} <br />
                                                        <i class="fa fa-bitcoin"></i> {{BitcoinAccount.Amount}} =
                                                        <span class="text-warning"><i class="fa fa-usd"></i> {{BitcoinAccount.Fee * BitcoinAccount.Amount}}</span>
                                                    </small>
                                                </p>
                                            </div>
                                        </div>
                                            <div class="form-group">
                                                <label><strong>Step 3:</strong> <br />Once Bitcoin is sent. Click check payment.</label>
                                            </div>
                                            <div class="form-group" ng-if="BitcoinAccount.BCTransactionId!=0">
                                                <label for="" class="col-sm-8 col-md-offset-3">                                                    
                                                    <button type="submit" class="btn btn-blue" ng-click="checkPaymentBitcoin(BitcoinAccount.BCTransactionId)" ng-disabled="processing">Check Payment Now</button>
                                                    <i ng-if="processing" class="fa fa-circle-o-notch fa-spin"></i>
                                                </label>
                                            </div>
                                        </div>
                                </div>
                            </div>
                        </form>

                        <form name="autoForm" id="autoForm" action="https://perfectmoney.is/api/step1.asp" method="POST" ng-if="showFormPerfectmoney">
                            <p class="text-align-center">
                                <img src="../assets/img/logo3.png" />
                                <h3 class="text-align-center"><i class="fa fa-3x fa-spinner fa-spin"></i> Processing...</h3>     
                            </p>                                                   
                            <div class="hide">
                                <input type="text" name="PAYMENT_ID" ng-model="perfectmoney.Id">
                                <input type="text" name="PAYEE_ACCOUNT" ng-model="perfectmoney.Payee_Account">
                                <input type="text" name="PAYEE_NAME" ng-model="perfectmoney.Payee_Name">
                                <input type="text" name="PAYMENT_AMOUNT" ng-model="perfectmoney.Payment_Amount">
                                <input type="text" name="PAYMENT_UNITS" ng-model="perfectmoney.Payment_Units">
                                <input type="text" name="STATUS_URL" ng-model="perfectmoney.Status_Url">
                                <input type="text" name="PAYMENT_URL" ng-model="perfectmoney.Payment_Url">
                                <input type="text" name="NOPAYMENT_URL" ng-model="perfectmoney.Nopayment_Url">
                                <input type="text" name="BAGGAGE_FIELDS" value="">
                                <input type="text" name="ORDER_NUM" ng-model="perfectmoney.Order_Num">
                                <input type="text" name="CUST_NUM" ng-model="perfectmoney.Cust_Num">
                                <input type="text" name="PAYMENT_METHOD" value="PerfectMoney">
                                <input type="text" name="SUGGESTED_MEMO" ng-model="perfectmoney.Momo">
                                <input type="text" name="SUGGESTED_MEMO_NOCHANGE" value="1">  
                            </div>                                                     
                        </form>                       


                        <script type="text/ng-template" id="Modal">
                            <div class="modal-header">
                                <i class="glyphicon glyphicon-check"></i>
                            </div>
                            <div class="modal-title">{{title}}</div>
                            <div class="modal-body">
                                {{ messeger }}
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-success" ng-click="ok()">OK</button>
                                <button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button>
                            </div>
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
